/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-11-28
 * Time: 13:23
 */
public class MyTimerTask implements Comparable<MyTimerTask>{
    private Runnable task;
    private long time;

    public MyTimerTask(Runnable runnable,long time) {
        this.task = runnable;
        this.time = time;
    }

    public long getTime() {
        return this.time;
    }

    public void toRun() {
        this.task.run();
    }

    @Override
    public int compareTo(MyTimerTask o) {
        return (int) (this.time-o.time);
    }
}
